deploy: support devicetree directory
authorStefan Agner <stefan.agner@toradex.com>
Tue, 4 Feb 2020 12:39:27 +0000 (13:39 +0100)
committerStefan Agner <stefan.agner@toradex.com>
Fri, 29 May 2020 17:56:11 +0000 (19:56 +0200)
commit5f08649f51fe15dcbf034b408a0770d3de3c9658
tree0521e41b079d917e1c26b59b7cfb3a730b2c2a77
parentc6eade5ce55a6bbc1005c547a1f3106fd9c2f662
deploy: support devicetree directory

Add support for a devicetree directory at /usr/lib/modules/$kver/dtb/.
In ARM world a general purpose distribution often suppports multiple
boards with a single operating system. However, OSTree currently only
supports a single device tree, which does not allow to use the same
OSTree on different ARM machines. In this scenario typically the boot
loader selects the effective device tree.

This adds device tree directory support for the new boot artefact
location under /usr/lib/modules. If the file `devicetree` does not
exist, then the folder dtb will be checked. All devicetrees are hashed
into the deployment hash. This makes sure that even a single devicetree
change leads to a new deployment and hence can be rolled back.

The loader configuration has a new key "devicetreepath" which contains
the path where devicetrees are stored. This is also written to the
U-Boot variable "fdtdir". The boot loader is expected to use this path
to load a particular machines device tree from.

Closes: #1900
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
src/libostree/ostree-bootloader-uboot.c
src/libostree/ostree-sysroot-deploy.c
tests/test-admin-deploy-uboot.sh